package com.pie4cloud.pie.job.api.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.pie4cloud.pie.common.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * @program: sod
 * @description:
 * @author: zzj
 * @create: 2019-12-20 15:14
 **/
@Data
@Entity
@Table(name = "T_DATA_DISPENSE_CONFIG")
public class DispenseCongfigEntity extends BaseEntity {
	@Id
	@Column(name = "ID",length = 11)
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	@GenericGenerator(name="snowflakeId", strategy="com.pie4cloud.pie.jpa.id.GenerateSnowflakeId")
	@GeneratedValue(generator="snowflakeId")
	@ApiModelProperty(value="id")
	private Long id;
	/**
	 * ftp 对应ID
	 */
	@Column(name = "ftp_id", length = 50)
	private Long ftpId;
	/**
	 * 四级编码
	 */
	@Column(name = "d_data_Id", length = 50)
	private String ddataId;

	@Column(name = "play_bill_id", length = 50)
	private Long playBillId;

	//资料名称
	@Column(name = "data_name", length = 50)
	private String dataName;
	/**
	 * 源目录
	 */
	@Column(name = "target_directory", length = 255)
	private String targetDirectory;
	/**
	 * 目标目录
	 */
	@Column(name = "source_directory", length = 255)
	private String sourceDirectory;
	/**
	 * 匹配正则全路径
	 */
	@Column(name = "target_filename", length = 255)
	private String targetFileName;
	/**
	 * 重命名
	 */
	@Column(name = "source_filename", length = 255)
	private String sourceFileName;

	//@OneToOne(optional=true,mappedBy = "dispenseCongfig")
	@OneToOne(targetEntity = DispenseHistoryEntity.class, cascade = CascadeType.ALL)
	@JoinColumn(name = "history_id")
	private DispenseHistoryEntity dispenseHistory;

	//@OneToOne(optional=true,mappedBy = "dispenseCongfig")
	@OneToOne(targetEntity = DispenseTimingEntity.class, cascade = CascadeType.ALL)
	@JoinColumn(name = "timing_id")
	private DispenseTimingEntity dispenseTiming;

	/**
	 * 0 实时 1定时
	 */
	@Column(name = "is_real_time", length = 1)
	private Integer isRealTime;

	@Column(name = "is_dmz", length = 1)
	private Integer isDmz;

	@Column(name = "dmz_path", length = 255)
	private String dmzPath;

	@Transient
	private ConfigFtp configFtp;

	/**
	 * 0 不分发 1分发历史 2只分发历史
	 */
	@Column(name="is_history", length=50)
	private Integer isHistory;

	//应发数
	@Column(name = "min_file_num", length = 50)
	private Integer minFileNum;


}

